package com.css.fxfzysx.modules.ysxManagement.controller;

import com.css.fxfzysx.base.response.RestResponse;
import com.css.fxfzysx.modules.ysxManagement.service.PdLevelService;
import com.css.fxfzysx.modules.ysxManagement.vo.PdLevelVo;
import com.css.fxfzysx.modules.ysxManagement.vo.PvRangeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 地下管网相关系数维护
 */
@RestController
@RequestMapping("pdLevel")
public class PdLevelController {

    @Autowired
    private PdLevelService pdLevelService;

    /**
     * 管道破坏等级划分添加或修改
     * @param pdLevelVo
     * @return
     */
    @PostMapping("saveOrUpdatePdLevel")
    public RestResponse saveOrUpdatePdLevel(@RequestBody PdLevelVo pdLevelVo){
        return pdLevelService.saveOrUpdatePdLevel(pdLevelVo);
    }

    /**
     * 管道破坏等级划分查询
     * @param titleName
     * @return
     */
    @GetMapping("getAllPdLevel")
    public RestResponse getAllPdLevel(String titleName){
        return pdLevelService.getAllPdLevel(titleName);
    }

    /**
     * 管道破坏等级划分删除
     * @param pdLevelIds
     * @return
     */
    @GetMapping("deletePdLevelById")
    public RestResponse deletePdLevelById(String pdLevelIds,String arrangeIds){
        return pdLevelService.deletePdLevelById(pdLevelIds,arrangeIds);
    }

    /**
     * 地下管网复杂性计算-易损性比对区间新增或修改
     * @param pvRangeVo
     * @return
     */
    @PostMapping("saveOrUpdatePvRange")
    public RestResponse saveOrUpdatePvRange(@RequestBody PvRangeVo pvRangeVo){
        return pdLevelService.saveOrUpdatePvRange(pvRangeVo);
    }

    /**
     * 地下管网复杂性计算-易损性比对区间查询
     * @param titleName
     * @return
     */
    @GetMapping("getAllPvRange")
    public RestResponse getAllPvRange(String titleName){
        return pdLevelService.getAllPvRange(titleName);
    }

    /**
     * 地下管网复杂性计算-易损性比对区间删除
     * @param pvRangeIds
     * @return
     */
    @GetMapping("deletePvRangeById")
    public RestResponse deletePvRangeById(String pvRangeIds,String arrangeIds){
        return pdLevelService.deletePvRangeById(pvRangeIds,arrangeIds);
    }
}
